package com.zq.it.action.exam;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.zq.it.action.BaseAction;
import com.zq.it.dao.common.PageConfig;
import com.zq.it.pojo.Student;
import com.zq.it.pojo.TClass;
import com.zq.it.pojo.Teacher;
import com.zq.it.pojo.exam.TClassPaper;
import com.zq.it.pojo.exam.TExamResult;
import com.zq.it.pojo.exam.TOptions;
import com.zq.it.pojo.exam.TPaper;
import com.zq.it.pojo.exam.TQuestions;
import com.zq.it.pojo.exam.data.ObjectData;
import com.zq.it.pojo.exam.data.PaperData;
import com.zq.it.tool.Constant;
import com.zq.it.tool.Html2Text;
import com.zq.it.tool.OfficeToolWord;
import com.zq.it.tool.StringUtil;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

/**
 * 
 * 试卷管理
 * 
 * @author 王凡
 * @version $ID: PaperAction.java 2013-8-12 王凡@$
 */
public class PaperAction extends BaseAction {
	private Teacher teacher;
	private ObjectData objList;
	private TPaper paper;
	private String startTime;
	private String endTime;
	private TClassPaper classPaper;
	private String postDate;
	private String[] ids;
	private List paperDetails;
	private List paperSection;
	private List qdb;
	private String[] rand_nums;
	private String[] rand_perscore;
	private String[] rand_dbid;
	private String[] rand_qtype;
	private String[] rand_cname;
	private List tclasses;
	private String msg;
	private Long uid; // 学生id
	private Long iid; // 考试结果id
	private Long score; // 具体的分数
	private TExamResult examResult;
	private TClass t_class;
	/**
	 * 进入试卷管理页面
	 * 
	 * @return
	 */
	public String getPaperList() {
		teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
		PageConfig config = new PageConfig();
		config.setHql("from TPaper as t where t.Teacher.id = '"
				+ teacher.getId() + "'");
		config.setCountHql(
				"select count(*) from TPaper as t where t.Teacher.id = '"
						+ teacher.getId() + "'");
		config.setPage(page);
		config.setPageSize(Constant.PAGE_SIZE);
		config.setPerPageCount(Constant.PER_PAGE_COUNT);
		config.setUrl("paper_getPaperList.asp");
		objList = paperService.getListByPage(config);
		return "getPaperList";
	}

	/**
	 * 进入创建试卷的界面
	 * 
	 * @return
	 */
	public String preAddPaper() {
		return "preAddPaper";
	}

	/**
	 * 创建试卷的验证
	 * 
	 */
	public void validateAddPaper() {
		if (null == paper) {
			addFieldError("paper.PName", "创建试卷错误");
		} else if (null == paper.getPName() || "".equals(paper.getPName())
				|| paper.getPName().length() > Constant.LENGTH_50) {
			addFieldError("paper.PName", "试卷名错误!");
		} else if (null == getStartTime()) {
			addFieldError("startTime", "开始日期不能为空!");
		} else if (null == getEndTime()) {
			addFieldError("endTime", "结束日期不能为空!");
		} else if (null == rand_cname || null == rand_perscore
				|| rand_cname.length != rand_perscore.length) {
			addFieldError("rand_nums", "设置章节出错！");
		}
	}

	/**
	 * 创建试卷
	 * 
	 * @throws IOException
	 * @throws ParseException
	 */
	public void addPaper() throws IOException, ParseException {
		teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd HH:mm");
		paper.setStartTime(formatter.parse(startTime));
		paper.setEndTime(formatter.parse(endTime));
		paper.setPostDate(formatter.parse(postDate));
		paperService.addPaper(teacher, paper, rand_cname, rand_dbid, rand_nums,
				rand_perscore, rand_qtype);
		print_html_utf8("<script> parent.delResult('增加成功！');</script>");
	}

	/**
	 * 进入编辑试卷页面
	 * 
	 * @return
	 */
	public String preEditPaper()

	{
		teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
		paper = paperService.getPaperById(ids[0], teacher);
		if (paper == null) {
			return "getPaperList";
		}
		paperSection = paperService.getPaperSections(paper.getId());
		return "preEditPaper";
	}

	/**
	 * 编辑试卷校验
	 * 
	 */
	public void validateEditPaper() {
		if (null == paper) {
			addFieldError("paper.PName", "创建试卷错误");
		} else if (null == paper.getPName() || "".equals(paper.getPName())
				|| paper.getPName().length() > Constant.LENGTH_50) {
			addFieldError("paper.PName", "试卷名错误!");
		} else if (null == getStartTime()) {
			addFieldError("startTime", "开始日期不能为空!");
		} else if (null == getEndTime()) {
			addFieldError("endTime", "结束日期不能为空!");
		} else if (null == rand_cname || null == rand_perscore
				|| rand_cname.length != rand_perscore.length) {
			addFieldError("rand_nums", "设置章节出错！");
		}
	}

	/**
	 * 修改试卷
	 * 
	 * @throws IOException
	 * @throws ParseException
	 */
	public void editPaper() throws IOException, ParseException {
		teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy/MM/dd HH:mm");
		paper.setStartTime(formatter.parse(startTime));
		paper.setEndTime(formatter.parse(endTime));
		paper.setPostDate(formatter.parse(postDate));
		try {
			paperService.updatePaper(teacher, paper, rand_cname, rand_dbid,
					rand_nums, rand_perscore, rand_qtype);
			print_html_utf8("<script> parent.delResult('修改成功！');</script>");
		} catch (Exception e) {
			e.printStackTrace();
			print_html_utf8(
					"<script> parent.delResult('修改失败！请确认试卷中没有试题并且该试卷没有分配班级！');</script>");
		}
	}

	/**
	 * 进入试卷详情页面
	 * 
	 * @return
	 */
	public String prePaperDetail() {
		teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
		paper = paperService.getPaperById(paper.getId() + "", teacher);
		if (null != paper) {
			paperDetails = paperService.getPaperDetails(paper, teacher);
			paperSection = paperService.getPaperSections(paper.getId());
			qdb = questionService.getQuestionDBList(teacher);
			return "prePaperDetail";
		} else {
			return "getPaperList";
		}
	}

	/**
	 * 分页获取页面试题
	 * 
	 * @throws IOException
	 * 
	 */
	public void getQuestions() throws IOException {
		teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
		String hql = paperService.createQuestionHql(teacher, rand_cname,
				rand_dbid, rand_qtype);
		PageConfig config = new PageConfig();
		config.setPage(page);
		config.setPerPageCount(Constant.PER_PAGE_COUNT);
		config.setPageSize(Constant.PAGE_SIZE);
		config.setCountHql("select count(*) " + hql);
		config.setHql(hql);
		objList = questionService.getListByPage(config);
		List<TQuestions> list = objList.getList();
		List retlist = new ArrayList();
		if ((list != null) && (list.size() > 0)) {
			Map m = null;
			for (TQuestions question : list) {
				m = new HashMap();
				m.put("ID", question.getId());
				m.put("CONTENT",
						Html2Text.Html2TextFormate(question.getContent()));
				m.put("DBID", question.getTQuestionDb().getId());
				m.put("QTYPE", question.getQType());
				retlist.add(m);
			}
			Map mapInfo = new HashMap();
			mapInfo.put("totalrows", objList.getTotalDataCount() + "");
			mapInfo.put("perpage", Constant.PAGE_SIZE + "");
			mapInfo.put("nowpage", page + "");
			mapInfo.put("totalpages", "");
			JSONArray jsonArray = JSONArray.fromObject(retlist);
			String data = jsonArray.toString();
			if (mapInfo != null) {
				String totalrows = (String) mapInfo.get("totalrows");
				String perpage = (String) mapInfo.get("perpage");
				String nowpage = (String) mapInfo.get("nowpage");
				String totalpages = (String) mapInfo.get("totalpages");

				String info = "\"info\":[";
				info = info + "{\"totalrows\":\"" + totalrows
						+ "\",\"perpage\":\"" + perpage + "\",\"nowpage\":\""
						+ nowpage + "\",\"totalpages\":\"" + totalpages + "\"}";
				info = info + "]";
				data = "{" + info + ",\"datalist\":" + data + "}";
			} else {
				data = "{\"datalist\":" + data + "}";
			}
			print_json_utf8(data);
		}
	}

	public void getQuestionDetail() throws IOException {
		teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
		TQuestions question = questionService.getQuestionById(ids[0], teacher);
		List<TOptions> question_options = null;
		List question_result_options = new ArrayList();
		if (question.getQType() == Constant.QTYPE_SELECT) {
			question_options = questionService.getOptionsList(question.getId());
			Map optionsMap = new HashMap();
			for (TOptions option : question_options) {
				optionsMap = new HashMap();
				optionsMap.put("OID",
						OfficeToolWord.formatOption(option.getOId()));
				optionsMap.put("SOPTION", option.getSoption());
				question_result_options.add(optionsMap);
			}
		}
		Map map = new HashMap();
		if (question != null) {
			map.put("CONTENT", question.getContent());
			map.put("QTYPE", question.getQType());
			map.put("SKEY", question.getSkey());
			map.put("OPTIONS", question_result_options);
			JSONObject jso = JSONObject.fromObject(map);
			String data = jso.toString();
			data = "{\"datalist\":" + data + "}";
			print_json_utf8(data);
		}
	}

	/**
	 * 校验试卷详情设置
	 * 
	 */

	public void validateUpdatePaperDetail() {
		String[] sid = getRequest().getParameterValues("sid");
		String[] qid = getRequest().getParameterValues("qid");
		String[] qscore = getRequest().getParameterValues("qscore");

		if (!((sid != null) && (qid != null) && (qscore != null)
				&& (sid.length >= 0) && (qid.length >= 0)
				&& (qscore.length >= 0) && (sid.length == qid.length)
				&& (qid.length == qscore.length))) {
			addFieldError("paper.id", "提示：根据系统需要，请保证试题至少保留一题！");
		}
	}
	/**
	 * 更改试题设置（还需考虑已考试的情况）
	 * 
	 * @return
	 * @throws IOException 
	 */
	public void updatePaperDetail() throws IOException {
		teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
		String[] sid = getRequest().getParameterValues("sid");
		String[] qid = getRequest().getParameterValues("qid");
		String[] qscore = getRequest().getParameterValues("qscore");

		if (paperService.updatePaperDetail(teacher, paper.getId(), sid, qid, qscore)) {
			print_html_utf8("<script>parent.showMsg('试题设置成功')</script>");
		} else {
			print_html_utf8("<script>parent.showMsg('试题设置失败！')</script>");
		}
	}

	/**
	 * 导出试卷到word
	 * 
	 */
	public void exportPaper() {
		teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
		PaperData data = paperService.getPaperData(teacher, paper.getId());
		if (null == data)
			return;
		try {
			OfficeToolWord.makePaperDoc(getRealPath(Constant.PAPER_EXPORT + "_"
					+ data.getPaper().getId() + ".doc"), data);
			download(
					URLEncoder.encode(data.getPaper().getPName() + ".doc",
							"UTF-8"),
					Constant.PAPER_EXPORT + "_" + data.getPaper().getId()
							+ ".doc");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * 进入已分配界面
	 * 
	 * @return
	 */
	public String preAssign() {
		PageConfig config = new PageConfig();
		config.setHql("from TClassPaper as t where t.TPaper.id='"
				+ paper.getId() + "'");
		config.setCountHql(
				"select count(*) from TClassPaper as t where t.TPaper.id='"
						+ paper.getId() + "'");
		config.setPage(page);
		config.setPageSize(Constant.PAGE_SIZE);
		config.setUrl("paper_preAssign.asp");
		config.setExtendUrl("paper.id=" + paper.getId());
		config.setPerPageCount(Constant.PER_PAGE_COUNT);
		objList = paperService.getAssignClass(config);
		return "preClassAssign";
	}

	/**
	 * 进入批量分配界面
	 * 
	 * @return
	 */
	public String preAddAssignClass() {
		teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
		PageConfig config = new PageConfig();
		config.setHql(
				"from TClass as t where t.id not in (select tcp.TClass.classId from TClassPaper tcp where tcp.TPaper.id="
						+ paper.getId() + ") and t.id in (select cm.tclass.classId from CourseManage as cm where cm.teacher.teacherId=" + teacher.getTeacherId() + ")");
		config.setCountHql(
				"select count(*) from TClass as t where t.id not in (select tcp.TClass.classId from TClassPaper tcp where tcp.TPaper.id="
						+ paper.getId() + ") and t.id in (select cm.tclass.classId from CourseManage as cm where cm.teacher.teacherId=" + teacher.getTeacherId() + ")");
		config.setPage(page);
		config.setPageSize(Constant.PAGE_SIZE);
		config.setUrl("paper_preAddAssignClass.asp");
		config.setExtendUrl("paper.id=" + paper.getId());
		config.setPerPageCount(Constant.PER_PAGE_COUNT);
		objList = classService.getListByPage(config);
		return "preAddAssignClass";
	}
	
	public String findClassesByTeacher() {
		teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
		String listQuery = "from TClass as t where t.id in (select cm.tclass.classId from CourseManage as cm where cm.teacher.teacherId=" + teacher.getTeacherId() + ")";
		String countQuery = "select count(*) from TClass as t where t.id in (select cm.tclass.classId from CourseManage as cm where cm.teacher.teacherId=" + teacher.getTeacherId() + ")";
		if (t_class!=null && t_class.getIshaveTask() != -1) {
			listQuery += " and t.ishaveTask=" + t_class.getIshaveTask();
			countQuery += " and t.ishaveTask=" + t_class.getIshaveTask();
		}
		if (t_class!=null && !StringUtil.isEmpty(t_class.getClassName())){
			listQuery += " and t.className like '%" + t_class.getClassName() +"%'";
			countQuery += " and t.className like '%" + t_class.getClassName() +"%'";
		}
		PageConfig config = new PageConfig();
		config.setHql(listQuery);
		config.setCountHql(countQuery);
		config.setPage(page);
		config.setPageSize(Constant.PAGE_SIZE);
		config.setUrl("paper_findClassesByTeacher.asp");
		config.setPerPageCount(Constant.PER_PAGE_COUNT);
		objList = classService.getListByPage(config);
		return "teacherClassList";
	}
	

	/**
	 * 批量分配班级
	 * 
	 * @throws IOException
	 * 
	 */
	public void classAssign() throws IOException {
		try {
			teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
			if (ids.length > 0 && null != paper && paper.getId() > 0) {
				paperService.addClassAssign(ids, paper.getId(), teacher);
				print_text_utf8("ok");
			} else {
				print_text_utf8("false");
			}
		} catch (Exception e) {
			print_text_utf8("false");
			e.printStackTrace();
		}
	}

	/**
	 * 进入试卷评阅界面
	 * 
	 * @return
	 */
	public String getExamClassList() {
		teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
		PageConfig config = new PageConfig();
		config.setHql("from TClassPaper as t where t.TPaper.Teacher.id ="
				+ teacher.getId() + " order by t.TPaper.postDate");
		config.setCountHql(
				"select count(*) from TClassPaper as t where t.TPaper.Teacher.id ="
						+ teacher.getId());
		config.setPage(page);
		config.setPageSize(Constant.PAGE_SIZE);
		config.setUrl("paper_getExamClassList.asp");
		config.setPerPageCount(Constant.PER_PAGE_COUNT);
		objList = paperService.getExamClassList(config);
		tclasses = classService.getAllClass();
		return "getExamClassList";
	}

	/**
	 * 多条件查询试卷评阅列表
	 * 
	 * @throws UnsupportedEncodingException
	 * 
	 */
	public String searchExamClassList() throws UnsupportedEncodingException {
		teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
		if (null != classPaper.getTPaper().getPName()
				&& !classPaper.getTPaper().getPName().isEmpty()) {
			classPaper.getTPaper().setPName(URLDecoder
					.decode(classPaper.getTPaper().getPName(), Constant.UTF_8));
		}
		String hql = paperService.createExamClassListHql(classPaper, startTime,
				endTime, teacher);
		PageConfig config = new PageConfig();
		config.setHql(hql);
		config.setCountHql("select count(*) " + hql);
		config.setPage(page);
		config.setPageSize(Constant.PAGE_SIZE);
		config.setUrl("paper_searchExamClassList.asp");
		config.setExtendUrl("classPaper.TPaper.PName="
				+ URLEncoder.encode(URLEncoder.encode(
						classPaper.getTPaper().getPName(), Constant.UTF_8),
				Constant.UTF_8) + "&classPaper.TClass.classId="
				+ classPaper.getTClass().getClassId() + "&startTime="
				+ startTime + "&endTime=" + endTime);
		config.setPerPageCount(Constant.PER_PAGE_COUNT);
		objList = paperService.getExamClassList(config);
		tclasses = classService.getAllClass();
		return "getExamClassList";
	}

	/**
	 * 删除试卷评阅列表
	 * 
	 * @throws IOException
	 * 
	 */
	public void delExamClassList() throws IOException {
		teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
		print_text_utf8(paperService.deleteExamClassList(teacher, ids));
	}

	/**
	 * 进入每场考试的准备批改的列表界面
	 * 
	 * @return
	 */
	/**
	 * @return
	 */
	public String preMarkList() {
		teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
		TClassPaper classPaper = paperService.findClassPaperById(ids[0],
				teacher);
		if (classPaper == null) {
			return getExamClassList();
		}

		PageConfig config = new PageConfig();
		config.setHql("from TExamResult as t where t.PId="
				+ classPaper.getTPaper().getId() + " and t.student.tclass.classId="
				+ classPaper.getTClass().getClassId());
		config.setCountHql("select count(*) from TExamResult as t where t.PId="
				+ classPaper.getTPaper().getId() + " and t.student.tclass.classId="
				+ classPaper.getTClass().getClassId());
		config.setPage(page);
		config.setPageSize(Constant.PAGE_SIZE);
		config.setUrl("paper_preMarkList.asp");
		config.setExtendUrl("id=" + ids[0]);
		config.setPerPageCount(Constant.PER_PAGE_COUNT);
		objList = paperService.getStudentExamRelList(config);
		return "preMarkList";
	}

	/**
	 * 多条件查询每场考试的准备批改的列表
	 * 
	 * @return
	 * @throws UnsupportedEncodingException
	 */
	public String searchExamResultList() throws UnsupportedEncodingException {
		teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
		TClassPaper classPaper = paperService.findClassPaperById(ids[0], teacher);
		if (classPaper == null) {
			return getExamClassList();
		}

		Student student = examResult.getStudent();
		if (student == null) {
			student = new Student();
		}
		examResult.setStudent(student);
		String hql = paperService.creatExamResultListHql(examResult, classPaper);
		PageConfig config = new PageConfig();
		config.setHql(hql);
		config.setCountHql("select count(*) " + hql);
		config.setPage(page);
		config.setPageSize(Constant.PAGE_SIZE);
		config.setUrl("paper_searchExamResultList.asp");
		config.setExtendUrl("ids=" + ids[0] + "&examResult.student.stuName=" + URLEncoder.encode(URLEncoder.encode(student.getStuName(), Constant.UTF_8), Constant.UTF_8) + "&examResult.student.stuId=" + student.getStuId());
		config.setPerPageCount(Constant.PER_PAGE_COUNT);
		objList = paperService.getStudentExamRelList(config);
		return "preMarkList";
	}

	/**
	 * 具体考试批改界面
	 * 
	 * @return
	 */
	public String examResultDetail() {
		teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
		Map map = paperService.getPaperResultDetail(teacher, ids[0]);
		if (map == null) {
			msg = "权限不足！";
			return "examResultDetailJump";
		}
		if (!(Boolean) map.get("data_check")) {
			msg = "该考生未提交试卷！";
			return "examResultDetailJump";
		}
		PaperData paperData = paperService.getPaperData(teacher,
				Long.parseLong(map.get("paper_id").toString()));
		getRequest().setAttribute("paperData", paperData);
		getRequest().setAttribute("examResultDetail", map);
		return "examResultDetail";
	}

	/**
	 * 更改学生题目的分数
	 * 
	 * @throws IOException
	 * 
	 */
	public void changeScore() throws IOException {
		teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
		msg = paperService.updateStudentScore(paper.getId(), uid, ids[0], iid,
				score, teacher);
		print_text_utf8(msg);
	}

	/**
	 * 多条件查询试卷
	 * 
	 * @return
	 * @throws UnsupportedEncodingException
	 */
	public String searchPaper() throws UnsupportedEncodingException {
		teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
		if (null != paper.getPName() && !paper.getPName().isEmpty()) {
			paper.setPName(URLDecoder.decode(paper.getPName(), Constant.UTF_8));
		}
		PageConfig config = new PageConfig();
		String hql = paperService.createPaperHql(paper, teacher);
		config.setHql(hql);
		config.setCountHql("select count(*) " + hql);
		config.setPage(page);
		config.setPageSize(Constant.PAGE_SIZE);
		config.setPerPageCount(Constant.PER_PAGE_COUNT);
		config.setUrl("paper_searchPaper.asp");
		config.setExtendUrl("paper.PName=" + URLEncoder.encode(
				URLEncoder.encode(paper.getPName(), Constant.UTF_8),
				Constant.UTF_8));
		objList = paperService.getListByPage(config);
		return "getPaperList";
	}

	/**
	 * 批量删除试卷
	 * 
	 * @throws IOException
	 * 
	 */
	public void delPaper() throws IOException {
		teacher = (Teacher) getHttpSession().getAttribute(Constant.TEACHER);
		print_text_utf8(paperService.deletePaper(teacher, ids));
	}

	/**
	 * ****************************************************** 以下为struts封装字段
	 * ******************************************************
	 */

	public Teacher getTeacher() {
		return teacher;
	}

	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}

	public ObjectData getObjList() {
		return objList;
	}

	public void setObjList(ObjectData objList) {
		this.objList = objList;
	}

	public TPaper getPaper() {
		return paper;
	}

	public void setPaper(TPaper paper) {
		this.paper = paper;
	}

	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public String getPostDate() {
		return postDate;
	}

	public void setPostDate(String postDate) {
		this.postDate = postDate;
	}

	public String[] getIds() {
		return ids;
	}

	public void setIds(String[] ids) {
		this.ids = ids;
	}

	public List getPaperDetails() {
		return paperDetails;
	}

	public void setPaperDetails(List paperDetails) {
		this.paperDetails = paperDetails;
	}

	public String[] getRand_nums() {
		return rand_nums;
	}

	public void setRand_nums(String[] rand_nums) {
		this.rand_nums = rand_nums;
	}

	public String[] getRand_perscore() {
		return rand_perscore;
	}

	public void setRand_perscore(String[] rand_perscore) {
		this.rand_perscore = rand_perscore;
	}

	public String[] getRand_dbid() {
		return rand_dbid;
	}

	public void setRand_dbid(String[] rand_dbid) {
		this.rand_dbid = rand_dbid;
	}

	public String[] getRand_qtype() {
		return rand_qtype;
	}

	public void setRand_qtype(String[] rand_qtype) {
		this.rand_qtype = rand_qtype;
	}

	public String[] getRand_cname() {
		return rand_cname;
	}

	public void setRand_cname(String[] rand_cname) {
		this.rand_cname = rand_cname;
	}

	public List getPaperSection() {
		return paperSection;
	}

	public void setPaperSection(List paperSection) {
		this.paperSection = paperSection;
	}

	public List getQdb() {
		return qdb;
	}

	public void setQdb(List qdb) {
		this.qdb = qdb;
	}

	public List getTclasses() {
		return tclasses;
	}

	public void setTclasses(List tclasses) {
		this.tclasses = tclasses;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Long getUid() {
		return uid;
	}

	public void setUid(Long uid) {
		this.uid = uid;
	}

	public Long getIid() {
		return iid;
	}

	public void setIid(Long iid) {
		this.iid = iid;
	}

	public Long getScore() {
		return score;
	}

	public void setScore(Long score) {
		this.score = score;
	}

	public TClassPaper getClassPaper() {
		return classPaper;
	}

	public void setClassPaper(TClassPaper classPaper) {
		this.classPaper = classPaper;
	}

	public TExamResult getExamResult() {
		return examResult;
	}

	public void setExamResult(TExamResult examResult) {
		this.examResult = examResult;
	}

	public TClass getT_class() {
		return t_class;
	}

	public void setT_class(TClass t_class) {
		this.t_class = t_class;
	}
	
	
}
